<template>
  <router-view>
    <template #default="{ Component, route }">
      <transition name="fade" mode="out-in" appear>
        <keep-alive v-if="isOpenComponentCache" :include="cacheComponentNames">
          <component :is="Component" :key="route.fullPath" />
        </keep-alive>
        <div v-else :key="route.name">
          <component :is="Component" :key="route.fullPath" />
        </div>
      </transition>
    </template>
  </router-view>
</template>

<script lang="ts">
export default {
  name: "c-page"
}
</script>

<script lang="ts" setup>
import {isOpenComponentCache} from "/@/config";
import {useCacheStore} from "/@/store/modules/cache";
import {storeToRefs} from "pinia";
const {noCacheComponentNames,cacheComponentNames} = storeToRefs(useCacheStore());
</script>

<style scoped>

</style>
